/*
 * This file is part of LazyCipher. LazyCipher is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version. LazyCipher is distributed in
 * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details. You should have received a
 * copy of the GNU General Public License along with LazyCipher. If not, see
 * <http://www.gnu.org/licenses/>.
 */
package org.lazycoder.Crypto.Ciphers;

import org.lazycoder.Crypto.Message;
import org.lazycoder.Crypto.Keys.Key;

/**
 * @author Matthew Bayliss
 */
public abstract class Cipher {
	/** The name of the cipher implemented. */
	protected String	name		= "";
	/**
	 * A description of the cipher. Keep it short, the GUI only has about two
	 * lines and long explanations are annoying in CLIs.
	 */
	protected String	Description	= "";
	/** A URL, for a wikipedia page or any other explanation of the cipher. */
	protected String	URL			= "";

	/**
	 * This needs to be implemented with the encryption algorithm.
	 * 
	 * @param message
	 *            An iteratable list of Letters.
	 * @param key
	 *            The key to use for encryption.
	 * @return Return a Message in encrypted form.
	 */
	public abstract Message encrypt(Message message, Key key);

	/**
	 * This needs to be implemented with the decryption algorithm.
	 * 
	 * @param message
	 *            An Encrypted Message (list of Letters)
	 * @param key
	 *            The key to use for decryption
	 * @return A Message that has been decrypted.
	 */
	public abstract Message decrypt(Message message, Key key);

	public String getName() {
		return name;
	}

	public String getDescription() {
		return Description;
	}

	public String getURL() {
		return URL;
	}
}
